﻿using System;

namespace 结构练习
{
    public struct Mycolor
    {
        public int _red;
        public int _green;
        public int _blue;
    }
    public struct person
    {
        public string _xm;
        public int _nl;
        public  Gender _gender;
    }
    public enum Gender

    {
        男,
        女
    }
    class Program
    {
        static void Main(string[] args)
        {
            //public public public public public public public public public public 
            //struct struct struct struct struct struct struct struct struct struct struct
            //struct struct struct struct struct struct struct struct struct struct struct 
            //struct struct struct
            //定义一个结构类型的person，有三个成员，分别为姓名，性别，年龄，性别用枚举类型
            //声明两个person类型的变量，分别代表，张三，男，18，小兰，女，16，
            person zs;
            person xl;
            zs._xm = "张三";
            zs._nl = 18;
            zs._gender = Gender.男;
            xl._xm = "小兰";
            xl._nl = 16;
            xl._gender = Gender.女;
            Console.WriteLine("我叫{0}，我今年{1}岁了，我是一个{2}生",zs._xm,zs._nl,zs._gender);
            Console.WriteLine("我叫{0}，我今年{1}岁了，我是一个{2}生",xl._xm,xl._nl,xl._gender);
            //定义一个结构叫Mycolor，有三个成员，分别定义为int类型的red，green，blue，
            //声明一个 Mycolor类型的变量，并将其成员赋值，使Mycolor表示成一个红色
            Mycolor a;
            a._red = 255;
            a._green = 0;
            a._blue = 0;
            Console.WriteLine(a._red);

        }
    }
}
